import React from "react"

export default React.createClass({
  render: function(){
    var props = this.props
    return (
      <form>
        <div className="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
          <input className="mdl-textfield__input" type={props.type || "text"} pattern={props.pattern} onChange={props.onChange}/>
          <label className="mdl-textfield__label">{props.text}</label>
          <span className="mdl-textfield__error">{props.errorMessage}</span>
        </div>
      </form>
    )
  }
})
